<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>无主题聚类-个性化定制</title>
    <link rel="stylesheet" href="../../../assert/css/font.css" th:href="@{/assert/css/font.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap.min.css" th:href="@{/assert/css/bootstrap.min.css}"/>
    <link rel="stylesheet" href="../../../assert/css/plugin/chosen/chosen.css"
          th:href="@{/assert/css/plugin/chosen/chosen.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap-table.css" th:href="@{/assert/css/bootstrap-table.css}"/>
    <link href="../../../assert/css/animate.min.css" rel="stylesheet" th:href="@{/assert/css/animate.min.css}">
    <link href="../../../assert/css/plugin/toastr/toastr.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/toastr/toastr.min.css}">
    <link href="../../../assert/css/plugin/jsTree/themes/default/style.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/jsTree/themes/default/style.css}">
    <link href="../../../assert/css/loaders.css" rel="stylesheet"
          th:href="@{/assert/css/loaders.css}">
    <link rel="stylesheet" href="../../../assert/css/bootstrapValidator.css"
          th:href="@{/assert/css/bootstrapValidator.css}"/>
    <link rel="stylesheet" href="../../../assert/css/jquery-ui.css" th:href="@{/assert/css/jquery-ui.css}"/>
    <link href="../../../assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/styles/jqx.base.css" rel="stylesheet"
          th:href="@{/assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/styles/jqx.base.css}"/>
    <link rel="stylesheet" href="../../../assert/css/index.css" th:href="@{/assert/css/index.css(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"/>
    <style>
        .search_group label.control-label{
            width:85px;
        }
        .downListModel{
            display:none;
        }
    </style>
</head>
<body>
<a id="basePath" th:href="@{/}"></a>
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="tools_bar">
            <div class="pull-left">
                <a href="#" class="btn btn-default active" id="btnSearch" title="隐藏查询条"><i class="fa fa-filter"></i> 隐藏</a>
                <a href="#" class="btn btn-default active" id="refresh"><i class="fa fa-refresh"></i> 刷新</a>
                <a href="#" class="btn btn-default active" id="btnAdd" title="添加任务"><i class="fa fa-plus"></i>
                    添加</a>
                <a href="#" class="btn btn-default active" id="btnEdit" title="编辑任务"><i class="fa fa-pencil"></i>
                    编辑</a>
                <a href="#" class="btn btn-default active" id="btnDel" title="删除任务"><i class="fa fa-trash"></i>
                    删除</a>
            </div>
        </div>
        <div class="search on">
            <div class="search_group">
                <label class="control-label">省份：</label>
                <div class="control-inline">
                    <select type="text" id="pro" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">任务名称：</label>
                <div class="control-inline">
                    <select type="text" id="taskName" value="" class="form-control search_input"></select>
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">创建人：</label>
                <div class="control-inline">
                    <input type="text" id="createP" value="" class="form-control search_input" autocomplete="off">
                </div>
            </div>
            <div class="search_group">
                <label class="control-label">处理状态：</label>
                <div class="control-inline">
                    <select type="text" id="proStatus" value="" class="form-control search_input"></select>
                </div>
            </div>

            <div class="search_group">
                <label class="control-label">创建时间：</label>
                <div class="control-inline">
                    <input placeholder="开始日期" class="form-control layer-date search_input" id="start1" autocomplete="off"> -
                    <input placeholder="结束日期" class="form-control layer-date search_input" id="end1" autocomplete="off">
                </div>
            </div>

            <div class="search_group">
                <button id="search" class="btn  btn-primary">查询</button>
                <button id="reset" class="btn  btn-default">重置</button>
                <button id="export" class="btn  btn-default hidden">导出</button>
            </div>
        </div>
        <table id="myTable"></table>
    </div>
</div>
<!--查看任务模态框-->
<div class="modal fade" id="lookModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog" style="width:900px !important;">
        <div class="modal-content">
            <form method="post" class="form-horizontal styleForm" id="lookForm">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">查看<span id="lookId"></span>任务条件</h4>
                </div>
                <div class="modal-body">
                    <div class="auditRow">
                        <div class="auditBox">
                            <label for="">省份</label>
                            <input type="text" style="width: 270px;" readonly id="lookPro">
                        </div>
                        <div class="auditBox">
                            <label for="" style="width: 164px;">通话时间段</label>
                            <input type="text" style="width: 270px;" readonly id="lookTime">
                        </div>
                    </div>
                    <div class="auditRow">
                        <div class="auditBox">
                            <label for="">业务分类</label>
                            <input type="text" style="width: 270px;" readonly id="lookClassify">
                        </div>
                        <div class="auditBox">
                            <label for="" style="width: 164px;">场景</label>
                            <input type="text" style="width: 270px;" readonly id="lookScence">
                        </div>
                    </div>
                    <div class="auditRow">
                        <div class="auditBox">
                            <label for="">满意度</label>
                            <input type="text" style="width: 270px;" readonly id="lookAgree">
                        </div>
                        <div class="auditBox">
                            <label for="" style="width: 164px;">重复来电</label>
                            <input type="text" style="width: 270px;" readonly id="lookRepeate">
                        </div>
                    </div>
                    <div class="auditRow">
                        <div class="auditBox">
                            <label for="">呼叫类型</label>
                            <input type="text" style="width: 270px;" readonly id="lookCall">
                        </div>
                        <div class="auditBox">
                            <label for="" style="width: 164px;">挂机方</label>
                            <input type="text" style="width: 270px;" readonly id="lookHook">
                        </div>
                    </div>
                    <div class="auditRow">
                        <div class="auditBox">
                            <label for="">分析内容</label>
                            <input type="text" style="width: 270px;" readonly id="lookContent">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!--添加任务模态框-->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog" style="width:1000px !important;">
        <div class="modal-content">
            <form method="post" class="form-horizontal styleForm" id="addForm">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">添加任务</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>省份:</label>
                            <div class="form-content">
                                <select name="" id="proModalAdd"></select>
                                <input type="text" class="form-control selectInput" id="proModalAddInput">
                            </div>
                        </div>
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>任务名称:</label>
                            <div class="form-content">
                                <input type="text" class="form-control" id="taskNameAdd" autocomplete="off">
                            </div>
                        </div>


                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>通话时间段:</label>
                            <div class="form-content">
                                <input placeholder="开始日期" class="form-control layer-date search_input" id="startTimeAdd"
                                       style="width:156px;" autocomplete="off"> -
                                <input placeholder="结束日期" class="form-control layer-date search_input" id="endTimeAdd"
                                       style="width:156px;" autocomplete="off">
                                <input type="text" class="form-control selectInput" id="timeModalAddInput">
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label"><span class="respan">*</span>分析内容:</label>
                            <div class="form-content checkbox">
                                <label style="margin-right:20px;"><input type="checkbox" name="key" value="0" >热词</label>
                                <label><input type="checkbox" name="key" value="1">诉求</label>
                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">业务分类:</label>
                            <div class="form-content">
                                <input type="text" id="serviceClassify" value="" class="form-control search_input" autocomplete="off" readonly>
                                <span class="fa fa-close" style="border-radius: 13px;float: right;margin-right: 2px;margin-top: -24px;cursor: pointer;display: none"></span>
                                <div class="downListModel scrollbar">
                                    <div class="search_box dataBox">
                                        <input type="text" autocomplete="off" style="width:205px;" id="searchInput"><span class="fa fa-search fa_btn"
                                                                                                                          id="searchMenu"></span>
                                    </div>
                                    <div id="jstree"></div>
                                </div>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">场景:</label>
                            <div class="form-content">
                                <select type="text" id="scene" value="" class="form-control search_input"></select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">重复来电:</label>
                            <div class="form-content">
                                <select type="text" id="repeatPhone" value="" class="form-control search_input"></select>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">呼叫类型:</label>
                            <div class="form-content">
                                <select type="text" id="callDirection" value="" class="form-control search_input"></select>
                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">挂机方:</label>
                            <div class="form-content">
                                <select type="text" id="onHookAdd" value="" class="form-control search_input" multiple></select>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">满意度:</label>
                            <div class="form-content">
                                <select type="text" id="agreeAdd" value="" class="form-control search_input" multiple></select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="addSave">保存</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--编辑任务模态框-->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog" style="width:1000px !important;">
        <div class="modal-content">
            <form method="post" class="form-horizontal styleForm" id="editForm">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">编辑任务</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>省份:</label>
                            <div class="form-content">
                                <select name="" id="proModalEdit"></select>
                                <input type="text" class="form-control selectInput" id="proModalEditInput">
                            </div>
                        </div>
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>任务名称:</label>
                            <div class="form-content">
                                <input type="text" class="form-control" id="taskNameEdit" autocomplete="off">
                            </div>
                        </div>


                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label for="" class="form-title control-label"><span class="respan">*</span>通话时间段:</label>
                            <div class="form-content">
                                <input placeholder="开始日期" class="form-control layer-date search_input" id="startTimeEdit"
                                       style="width:156px;" autocomplete="off"> -
                                <input placeholder="结束日期" class="form-control layer-date search_input" id="endTimeEdit"
                                       style="width:156px;" autocomplete="off">
                                <input type="text" class="form-control selectInput" id="timeModalEditInput">
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label"><span class="respan">*</span>分析内容:</label>
                            <div class="form-content checkbox">
                                <label style="margin-right:20px;"><input type="checkbox" name="keyEdit" value="0" >热词</label>
                                <label><input type="checkbox" name="keyEdit" value="1">诉求</label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">业务分类:</label>
                            <div class="form-content">
                                <input type="text" id="serviceClassify" value="" class="form-control search_input" autocomplete="off" readonly>
                                <span class="fa fa-close" style="border-radius: 13px;float: right;margin-right: 2px;margin-top: -24px;cursor: pointer;display: none"></span>
                                <div class="downListModel scrollbar">
                                    <div class="search_box dataBox">
                                        <input type="text" autocomplete="off" style="width:205px;" id="searchInput"><span class="fa fa-search fa_btn"
                                                                                                                          id="searchMenu"></span>
                                    </div>
                                    <div id="jstree"></div>
                                </div>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">场景:</label>
                            <div class="form-content">
                                <select type="text" id="scene" value="" class="form-control search_input"></select>
                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">重复来电:</label>
                            <div class="form-content">
                                <select type="text" id="repeatPhoneEdit" value="" class="form-control search_input"></select>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">呼叫类型:</label>
                            <div class="form-content">
                                <select type="text" id="callDirectionEdit" value="" class="form-control search_input"></select>
                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="form-box">
                            <label class="form-title control-label">挂机方:</label>
                            <div class="form-content">
                                <select type="text" id="onHookEdit" value="" class="form-control search_input" multiple></select>
                            </div>
                        </div>
                        <div class="form-box">
                            <label class="form-title control-label">满意度:</label>
                            <div class="form-content">
                                <select type="text" id="agreeEdit" value="" class="form-control search_input" multiple></select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="editSave">保存</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!--删除确认框-->
<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
    <div class="modal-dialog">
        <div class="modal-content">
            <form method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span
                            class="sr-only">Close</span></button>
                    <h4 class="modal-title">删除</h4>
                </div>
                <div class="modal-body">
                    <div style="text-align: center"><span class="fa fa-question-circle"></span><span
                            id="delName"></span>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="delBtn">确定</button>
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>
<form action="" id="formDetail" class="hidden" target="_blank">
    <input type="text" name="taskId">
    <input type="text" name="taskName">
    <input type="text" name="contentType">
</form>
<input type="text" id="classify" class="hidden">
<input type="text" id="proSelectModal" class="hidden">
<script src="../../../assert/js/jquery.js" th:src="@{/assert/js/jquery.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/bootstrap.min.js" th:src="@{/assert/js/bootstrap.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script src="../../../assert/js/bootstrapValidator.js" th:src="@{/assert/js/bootstrapValidator.js}"></script>
<script src="../../../assert/js/plugin/toastr/toastr.min.js"
        th:src="@{/assert/js/plugin/toastr/toastr.min.js}"></script>
<script src="../../../assert/js/base.js" th:src="@{/assert/js/base.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/jquery-ui.min.js" th:src="@{/assert/js/jquery-ui.min.js}"></script>
<script src="../../../assert/js/plugin/layer/laydate/laydate.js"
        th:src="@{/assert/js/plugin/layer/laydate/laydate.js}"></script>
<script src="../../../assert/js/changeTime.js" th:src="@{/assert/js/changeTime.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/jsTree/jstree.min.js"
        th:src="@{/assert/js/plugin/jsTree/jstree.min.js}"></script>
<script src="../../../assert/js/plugin/chosen/chosen.jquery.js"
        th:src="@{/assert/js/plugin/chosen/chosen.jquery.js}"></script>
<script src="../../../assert/js/common.js" th:src="@{/assert/js/common.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/jqxcore.js"
        th:src="@{/assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/jqxcore.js}"></script>
<script src="../../../assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/jqxvalidator.js"
        th:src="@{/assert/js/lib/jqwidgets-ver4.0.0/jqwidgets/jqxvalidator.js}"></script>
<script src="../../../assert/js/contabs.min.js" th:src="@{/assert/js/contabs.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script>
    //项目名称
    var basePath = $("#basePath").attr("href");
    var json = [];
    //    页面主表格
    var TableInit = function () {
        var oTableInit = new Object();
        var url = tools.urlPrev + "/customMade/getTaskInfos";
        //初始化Table
        oTableInit.Init = function () {
            $('#myTable').bootstrapTable("destroy");
            $('#myTable').bootstrapTable({
//                data:json,
                url: url,         //请求后台的URL（*）
                method: 'post',                      //请求方式（*）
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                sortable: false,                     //是否启用排序
                sortName: "provinceCode", //排序方式
                sortOrder: "asc",
                pagination: true,    //排序方式
                queryParams: oTableInit.queryParams,//传递参数（*）
                responseHandler: function (res) {
                    if (res.rtnCode != 0) {
                        toastrCog.error(res.rtnMsg, 2000);
                    }
                    return {
                        "total": res.data.total,//总页数
                        "rows": res.data.list   //数据
                    };
                },
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/json",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "no",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                columns: [
                    {
                        checkbox: true, // 显示一个勾选框
                        align: 'center' // 居中显示
                    },
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        field: 'id',
                        formatter: function (value, row, index) {
                            var getOptions = $("#myTable").bootstrapTable('getOptions');
                            var pagenum = getOptions.pageNumber;
                            var pagesize = getOptions.pageSize;
                            var st = (pagenum - 1) * pagesize;
                            return (st + index + 1) + "";
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'provinceCode',
                        title: '省份',
                        sortable: true,
                        formatter:function(value, row, index){
                            return  bs.getXInY(tools.proArr,"name","value",value)
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'taskName',
                        title: '任务名称',
                        sortable: true,
                        formatter:function(value, row, index){
                            return  '<div class="fileNameLook" data-id="'+row.id+'">'+value+'</div>'
                        },
                        events: {
                            'click .fileNameLook': function (e, value, row, index) {
                                $.ajax({
                                    type: "post",
                                    url: tools.urlPrev + "/customMade/getTaskInfoById",
                                    dataType: "json",
                                    contentType: "application/json",
                                    data: JSON.stringify({
                                        taskId: row.taskId
                                    }),
                                    success: function (data) {
                                        if (data.rtnCode == 0) {
                                            var msg=data.data;
                                            var satisfaction=tools.rootMultipleArr(tools.agreeArr,msg.satisfaction,0);
                                            var onHook=tools.rootMultipleArr(tools.onHookArr,msg.onHook,0);
                                            var content="";
                                            if(msg.content==0){
                                                content="热词"
                                            }else if(msg.content==1){
                                                content="诉求"
                                            }else if(msg.content==2){
                                                content="热词,诉求"
                                            }
                                            $("#lookModal").modal("show");
                                            $("#editForm")[0].reset();
                                            $("#lookId").html("("+row.taskName+")");
                                            $("#lookPro").val(bs.getXInY(tools.proArr,"name","value",msg.provinceCode));
                                            $("#lookTime").val(msg.callStartTime+"-"+msg.callEndTime);
                                            $("#lookClassify").val(msg.serviceName).attr("title",msg.serviceName);
                                            $("#lookScence").val(msg.sceneName).attr("title",msg.sceneName);
                                            $("#lookAgree").val(satisfaction.join(",")).attr("title",satisfaction.join(","));
                                            $("#lookCall").val(bs.changeState(msg.callDirection,tools.callDirectionArr));
                                            $("#lookRepeate").val(bs.changeState(msg.recallFlag,tools.reCallFlagArr));
                                            $("#lookContent").val(content).attr("title",content);
                                            $("#lookHook").val(onHook.join(",")).attr("title",onHook.join(","));

                                        } else {
                                            toastrCog.error(data.msg, 3000)
                                        }
                                    }
                                })
                            }
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'userName',
                        title: '创建人',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'createTime',
                        title: '创建时间',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return value;
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'finishTime',
                        title: '完成时间',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return value;
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'status',
                        title: '处理状态',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.changeState(value, tools.stateArr);
                        }
                    }, {
                        field: 'Button',
                        title: '操作',
                        formatter: function (value, row, index) {
                            $.ajax({
                                type: "post",
                                url: tools.urlPrev + "/customMade/getTaskInfoById",
                                dataType: "json",
                                contentType: "application/json",
                                async:false,
                                data: JSON.stringify({
                                    taskId: row.taskId
                                }),
                                success: function (data) {
                                    if (data.rtnCode == 0) {
                                        var msg=data.data;
                                        $("#formDetail").find("input[name='contentType']").val(msg.content);
                                    }
                                }
                            });
                            $("#formDetail").find("input[name='taskId']").val(row.taskId);
                            $("#formDetail").find("input[name='taskName']").val(row.taskName);
                            var params=$("#formDetail").serialize();
                            var href=basePath + "/rest/page/personalResult?"+params;
                            return '<a href="'+href+'" class="fa fa-eye handleBtn J_menuItem" title="查看结果详情" data-index="personal" data-txt="'+row.taskName+'-结果分析" data-href="/rest/page/personalResult"></a>'
                        }
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    if (!data.rows||data.rows.length == 0) {
                        var src=basePath+"/assert/image/nodata.png";
                        $("#myTable .no-records-found").find("td").html('<img src="'+src+'" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                },
                onLoadError: function () {  //加载失败时执行
                    var src=basePath+"/assert/image/nodata.png";
                    $("#myTable .no-records-found").find("td").html('<img src="'+src+'" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                }
            });
        };
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNum: params.offset,   //页面大小
                pageSize: params.limit,
                provinceCode: $("#pro").val(),
                taskId: $("#taskName").val(),
                userName:$.trim($("#createP").val()),
                status: $("#proStatus").val(),
                startTime: $("#start1").val(),
                endTime: $("#end1").val()
            };
            return temp;
        };
        return oTableInit;
    };
    var resize = {
        init: function () {
            resize.me();
            $(window).resize(function () {
                resize.me();
            })
        },
        me: function () {
            var winW = $(window).width();
            var winH = $(window).height();
            $(".ibox").width(winW - 20);
            $(".ibox").height(winH - 20);
        }
    };
    var tools = {
        seatIdArr:[],
        modelSelectArr: [],
        taskArr: [
            {
                "name": "全部",
                "value": ""
            }
        ],
        stateArr: [
            {
                name: "全部",
                value: ""
            }
        ],
        proArr: [],
        creatPersonArr: [
            {
                name: "全部",
                value: ""
            }
        ],
        seatGroupArr: [
            {
                name: "全部",
                value: ""
            }
        ],
        callDirectionArr: [],//用来存储呼叫类型状态
        onHookArr: [],//用来存储挂机方状态
        reCallFlagArr: [],//用来存储重复来电状态
        agreeArr: [],//用来存储满意度状态
        taskTypeArr:[],//用来存储满意度状态
        sceneArr:[{
            name: "请选择",
            value: ""
        }],//场景
        urlPrev:null,
        num:0,
        maxTextLength:null,
        init: function () {
            var maxNum= bs.getSysConfig("NAME_LIMIT");
            var num=50;
            if(maxNum.value){
                num=maxNum.value
            }
            tools.maxTextLength= num;
            tools.selectInit();//下拉框，日期插件初始化
            tools.tabSearch();//是否显示查询条
            tools.search();//查询
            tools.enterSearch();//查询
            tools.reset();//重置
            tools.refresh();//刷新
            tools.addModel();//添加任务
            tools.editModel();//编辑任务
            tools.delModel();//删除任务
            $("#addModal").on("shown.bs.modal",function(){
                if(tools.num==0){
                    menuWork.init(1,$("#proModalAdd").val(),$("#addModal #jstree"));
                }
                tools.sceneArr=[{
                    name: "请选择",
                    value: ""
                }];
                bs.selectDown($("#scene"), tools.sceneArr,"","100%");
                tools.num++;
                tools.resetSelect($("#onHookAdd"));
                tools.resetSelect($("#agreeAdd"));
            });
            $("#addModal").on("hidden.bs.modal",function(){
                var form=$("#addForm");
                tools.hideLabel(form,'#proModalAddInput');
                tools.hideLabel(form,'#timeModalAddInput');
                tools.hideLabel(form,'#taskNameAdd');
                $("#serviceClassify").next().hide();
            });
            $("#editModal").on("hidden.bs.modal",function(){
                var form=$("#editForm");
                tools.hideLabel(form,'#proModalEditInput');
                tools.hideLabel(form,'#timeModalEditInput');
                tools.hideLabel(form,'#taskNameEdit');
            });
            $("#addModal #serviceClassify").on("click", function () {
                if(!$("#proModalAdd").val()){
                    toastrCog.error("请选择省份！")
                }else{
                    $(this).nextAll(".downListModel").show();
                }
            });
            $("#editModal #serviceClassify").on("click", function () {
                if(!$("#proModalEdit").val()){
                    toastrCog.error("请选择省份！")
                }else{
                    $(this).nextAll(".downListModel").show();
                }
            });
            //点击空白处
            $(document).click(function (e) {
                var _con = $("#serviceClassify,.downListModel");
                if (!_con.is(e.target) && _con.has(e.target).length === 0) {
                    $('.downListModel ').hide();
                    $("#searchMenu").prev().val("");
                }
            });
            $("#scene").on("change", function (event, sel) {
                var msg=JSON.parse($(this).attr("data-msg"));
                if(msg && msg.length>0){
                    for(var i=0;i<msg.length;i++){
                        if(sel.selected==msg[i].value){
                            $(this).attr("data-name",msg[i].subTxt);
                        }
                    }
                }
            });
        },
        hideLabel:function(form,input){
            form.jqxValidator('hideHint', input);
        },
        selectInit: function () {
            bs.dataTime("#start1", "#end1");
            bs.dataTime("#startTimeAdd", "#endTimeAdd");
            bs.dataTime("#startTimeEdit", "#endTimeEdit");
            tools.getState();//获取预质检状态
            tools.getHook();
            tools.getSatStatus();
            tools.getReCallFlag();
            tools.getCallDirection();
            tools.selectProvince();
            tools.getTaskNameData($("#pro").val());
            tools.selectChange($("#proModalAdd"),$("#proModalAddInput"));
            tools.selectChange($("#proModalEdit"),$("#proModalEditInput"));
            tools.getScene(tools.sceneArr);
            $("#pro").on("change", function (event, sel) {
                tools.getTaskNameData($("#pro").val());//获取任务
            });
            $("#proModalAdd").on("change", function (event, sel) {
                menuWork.init(1,$("#proModalAdd").val(),$("#addModal #jstree"));
                $("#serviceClassify").val("").next("span").hide();
            });
            $("#proModalEdit").on("change", function (event, sel) {
                menuWork.init(1,$("#proModalEdit").val(),$("#editModal #jstree"));
                $("#serviceClassify").val("").next("span").hide();
            });
        },
        selectChange:function($elem,$input){
            $elem.on("change", function (event, sel) {
                $input.val(sel.selected);
                if (sel.selected == "") {
                    $input.next().html("").css("display", "none !important");
                }
            });
        },
        selectProvince: function () {
            tools.proArr = bs.getProvince();
            bs.selectDown($("#pro"), tools.proArr, "");
            bs.selectDown($("#proModalAdd"), tools.proArr, "","100%");
            bs.selectDown($("#proModalEdit"), tools.proArr, "","100%");
        },
        getTaskNameData: function (code) {
            $.ajax({
                type: "post",
                url: tools.urlPrev + "/customMade/getTaskNameList",
                dataType: "json",
                async:false,
                contentType: 'application/json',
                data: JSON.stringify({
                    provinceCode:code
                }),
                success: function (data) {
                    if (data.rtnCode == 0) {
                        var dataArr = data.data;
                        tools.taskArr = [{name: "全部", value: ""}];
                        for (var i = 0; i < dataArr.length; i++) {
                            var obj = {};
                            obj.name = dataArr[i].taskName;
                            obj.value = dataArr[i].taskId;
                            tools.taskArr.push(obj);
                        }
                        bs.selectDown($("#taskName"), tools.taskArr);
                    } else {
                        toastrCog.error(data.rtnMsg, 3000)
                    }
                }
            })
        },
        getScene:function(){
            bs.selectDown($("#scene"), tools.sceneArr,"","100%");
        },
        getHook: function () {
            var dataArr = bs.getStatus("audio_onhook");
            Object.assign(tools.onHookArr,dataArr);//es6复制数组的方法
            tools.onHookArr.shift();
            bs.selectDown($("#onHookAdd"), tools.onHookArr,"","100%");
            bs.selectDown($("#onHookEdit"), tools.onHookArr,"","100%");
        },
        getSatStatus: function () {
            var dataArr = bs.getStatus("audio_satisfaction");
            Object.assign(tools.agreeArr,dataArr);//es6复制数组的方法
            tools.agreeArr.shift();
            bs.selectDown($("#agreeAdd"), tools.agreeArr,"","100%");
            bs.selectDown($("#agreeEdit"), tools.agreeArr,"","100%");
        },
        getReCallFlag:function(){
            var dataArr = bs.getStatus("recall_flag");
            Object.assign(tools.reCallFlagArr,dataArr);//es6复制数组的方法
            bs.selectDown($("#repeatPhone"), tools.reCallFlagArr,"","100%");
            bs.selectDown($("#repeatPhoneEdit"), tools.reCallFlagArr,"","100%");
        },
        getCallDirection:function(){
            var dataArr = bs.getStatus("call_direction");
            Object.assign(tools.callDirectionArr,dataArr);//es6复制数组的方法
            bs.selectDown($("#callDirection"), tools.callDirectionArr,"","100%");
            bs.selectDown($("#callDirectionEdit"), tools.callDirectionArr,"","100%");
        },
        getState: function () {
            var dataArr = bs.getStatus("task_export_status");
            Object.assign(tools.stateArr, dataArr);//es6复制数组的方法
            bs.selectDown($("#proStatus"), tools.stateArr);
        },
        tipShow: function () {
            $(".tipInput").hover(function () {
                $(this).find(".tip").removeClass("hidden")
            }, function () {
                $(this).find(".tip").addClass("hidden")
            })
        },
        tabSearch: function () {
            var search = $(".search");
            $("#btnSearch").on("click", function () {
                if (search.hasClass("on")) {
                    search.slideUp();
                    search.removeClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 查询').attr("title", "显示查询条");
                } else {
                    search.slideDown();
                    search.addClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 隐藏').attr("title", "隐藏查询条");
                }

            });
        },
        search: function () {
            $("#search").on("click", function () {
                tools.tableRefresh();
            })
        },
        enterSearch: function () {
            $("body").on("keyup", function (e) {
                var code = e.charCode || e.keyCode;
                if (code == 13) {
                    //此处编写用户敲回车后的代码
                    tools.tableRefresh();
                }
            })
        },
        tableRefresh: function () {
            $("#myTable").bootstrapTable('refresh');
        },
        reset: function () {
            $("#reset").on("click", function () {
                bs.resetSearch($(".search"));
                tools.getTaskNameData($("#pro").val());//获取任务

                tools.tableRefresh();
            })
            $("#resetModel").on("click",function(){
                $("#classify").val("");
                $("#proSelectModal").val("");
                $("#jstree").jstree("deselect_all", true);
                $("#modelTableWin").bootstrapTable('refresh');
            })
        },
        resetSelect: function ($obj) {
            $obj.val("");
            $obj.trigger("chosen:updated");
        },
        refresh: function () {
            $("#refresh").on("click", function () {
                tools.tableRefresh();
            })
        },
        addModel: function () {
            $("#addModal").on("hide.bs.modal", function () {
                $('#addForm')[0].reset();
                if(tools.proArr.length>2){
                    tools.resetSelect($("#proModalAdd"));
                }
                tools.resetSelect($("#seatGroupModalAdd"));
                tools.selectProvince();
            });
            $("#btnAdd").on("click", function () {
                $("#addModal").modal("show");
            });
            $("#addSave").on("click", function () {
                $("#addForm").jqxValidator("validate");
            });
            $("#addForm").on("validationSuccess", function (event) {
                var satisfactionAddList = $("#agreeAdd").val();
                if (!satisfactionAddList) {
                    satisfactionAddList = [];
                }
                var onHookAddList = $("#onHookAdd").val();
                if (!onHookAddList) {
                    onHookAddList = [];
                }
                var key=$("input[name='key']:checked").val();
                if($("input[name='key']:checked").length==2){
                    key=2;
                }
                if($("input[name='key']:checked").length==0){
                    toastrCog.error("请选择分析内容！");
                    return
                }
                $.ajax({
                    type: "post",
                    url: tools.urlPrev + "/customMade/createTask",
                    dataType: "json",
                    contentType: 'application/json',
                    data:JSON.stringify({
                        "callDirection": $("#callDirection").val(),
                        "callEndTime": $("#startTimeAdd").val(),
                        "callStartTime": $("#endTimeAdd").val(),
                        "content": key,
                        "onHook": onHookAddList.join(","),
                        "provinceCode":  $("#proModalAdd").val(),
                        "recallFlag": $("#repeatPhone").val(),
                        "satisfaction":satisfactionAddList.join(","),
                        "sceneName":$("#scene").val(),
                        "serviceId": $("#serviceClassify").attr("data-id"),
                        "serviceName": $("#serviceClassify").val(),
                        "taskName": $("#taskNameAdd").val(),
                        "userName": $("#spanId",parent.document).attr("title")
                    }),
                    success: function (data) {
                        if (data.rtnCode == 0) {
                            tools.tableRefresh();
                            toastrCog.success("添加成功", 1000)
                            tools.getTaskNameData($("#pro").val());//获取任务
                        } else {
                            toastrCog.error("添加失败", 2000)
                        }
                        $("#addModal").modal("hide");
                    }
                })
            })
        },
        editModel: function () {
            $("#btnEdit").on("click", function () {
                var selectArr = $("#myTable").bootstrapTable("getSelections");
                if (selectArr.length <= 0) {
                    toastrCog.error("请选择要编辑的数据！", 1000);
                } else if (selectArr.length > 1) {
                    toastrCog.error("请选择一条要编辑的数据！", 1000);
                } else {
                    $("#editModal").modal("show");
                    $("#proModalEdit").val(selectArr[0].provinceCode).trigger("chosen:updated");
                    $("#proModalEditInput").val($("#proModalEdit").val());
                    menuWork.init(1,$("#proModalEdit").val(),$("#editModal #jstree"),$("#editModal #serviceClassify"),$("#editModal #scene"));
                    $("#taskNameEdit").val(selectArr[0].taskName);
                    $.ajax({
                        type: "post",
                        url: tools.urlPrev + "/customMade/getTaskInfoById",
                        dataType: "json",
                        contentType: "application/json",
                        data: JSON.stringify({
                            taskId:selectArr[0].taskId
                        }),
                        success: function (data) {
                            if (data.rtnCode == 0) {
                                var msg=data.data;
                                $("#startTimeEdit").val(msg.callStartTime);
                                $("#endTimeEdit").val(msg.callEndTime);
                                $("#editModal #serviceClassify").val(msg.serviceName).attr("data-id",msg.serviceId);
                                if(msg.serviceName!=""){
                                    $("#editModal #serviceClassify").next().show();
                                }
                                $("#editModal #scene").val(msg.scene);
                                var satisfactionArr=[];
                                if (msg.satisfaction) {
                                    satisfactionArr = msg.satisfaction.split(",");
                                }
                                var onHooksArr=[];
                                if (msg.onHook) {
                                    onHooksArr = msg.onHook.split(",");
                                }
                                $("#agreeEdit").val(satisfactionArr).trigger("chosen:updated");
                                $("#onHookEdit").val(onHooksArr).trigger("chosen:updated");
                                $("#repeatPhoneEdit").val(msg.recallFlag).trigger("chosen:updated");
                                $("#callDirectionEdit").val(msg.callDirection).trigger("chosen:updated");
                                $("input[name='keyEdit'][value='0").prop("checked",false);
                                $("input[name='keyEdit'][value='1").prop("checked",false);
                                if(msg.content==0 || msg.content==1){
                                    $("input[name='keyEdit'][value='"+msg.content+"']").prop("checked",true);
                                }else if(msg.content==2){
                                    $("input[name='keyEdit'][value='0").prop("checked",true);
                                    $("input[name='keyEdit'][value='1").prop("checked",true);
                                }
                                var sceneArr = bs.getSenceData(selectArr[0].provinceCode, msg.serviceId);
                                sceneArr.unshift({"name": "请选择", "value": ""});
                                bs.selectDownNoDisabled($("#editModal #scene"), sceneArr, "", "100%");
                                $("#editModal #scene").val(msg.sceneName).trigger("chosen:updated");
                            }
                        }
                    });
                    $("#editModal").attr("data-id", selectArr[0].taskId);
                }
            });
            $("#editSave").on("click", function () {
                $("#editForm").jqxValidator("validate");
            });
            $("#editForm").on("validationSuccess", function (event) {
                var id = $("#editModal").attr("data-id");
                var satisfactionAddList = $("#agreeEdit").val();
                if (!satisfactionAddList) {
                    satisfactionAddList = [];
                }
                var onHookAddList = $("#onHookEdit").val();
                if (!onHookAddList) {
                    onHookAddList = [];
                }
                var key=$("input[name='keyEdit']:checked").val();
                if($("input[name='keyEdit']:checked").length==2){
                    key=2;
                }
                if($("input[name='keyEdit']:checked").length==0){
                    toastrCog.error("请选择分析内容！");
                    return
                }
                $.ajax({
                    type: "post",
                    url: tools.urlPrev + "/customMade/createTask",
                    dataType: "json",
                    contentType: 'application/json',
                    data:JSON.stringify({
                        "callDirection": $("#callDirectionEdit").val(),
                        "callEndTime": $("#startTimeEdit").val(),
                        "callStartTime": $("#endTimeEdit").val(),
                        "content": key,
                        "onHook": onHookAddList.join(","),
                        "provinceCode":  $("#proModalEdit").val(),
                        "recallFlag": $("#repeatPhoneEdit").val(),
                        "satisfaction":satisfactionAddList.join(","),
                        "sceneName":$("#scene").val(),
                        "serviceId": $("#serviceClassify").attr("data-id"),
                        "serviceName": $("#serviceClassify").val(),
                        "taskName": $("#taskNameEdit").val(),
                        "taskId": id,
                        "userName": $("#spanId",parent.document).attr("title")
                    }),
                    success: function (data) {
                        if (data.rtnCode == 0) {
                            toastrCog.success("修改成功",1000)
                            tools.getTaskNameData($("#pro").val());//获取任务
                        } else {
                            toastrCog.error("修改失败", 2000)
                        }
                        tools.tableRefresh();
                        $("#editModal").modal("hide");
                    }
                })
            })
        },
        delModel: function () {
            $("#btnDel").on("click", function () {
                var selectArr = $("#myTable").bootstrapTable("getSelections");
                if (selectArr.length <= 0) {
                    toastrCog.error("请选择要删除的数据！", 1000);
                }else{
                    $("#delModal").modal("show");
                    $("#delName").html(
                        "确定要删除所选的"+
                        "<span style='color:rgb(50, 136, 226)'>"+selectArr.length+"</span>"+
                        "条数据"+
                        "<span style='color:rgb(50, 136, 226)'>"+tools.getStr(selectArr,"taskId")+"</span>吗？");
                    $("#delModal").attr("data-id", tools.getStr(selectArr,"taskId"));
                }

            });
            $("#delBtn").on("click", function () {
                var id = $("#delModal").attr("data-id");
                var idArr =id.split(",");
                $.ajax({
                    type: "post",
                    url: tools.urlPrev + "/customMade/deleteTask",
                    dataType: "json",
                    contentType: 'application/json',
                    data: JSON.stringify({
                        taskIds: idArr
                    }),
                    success: function (data) {
                        if (data.rtnCode == 0) {
                            tools.tableRefresh();
                            toastrCog.success("删除成功", 1000)
                            tools.getTaskNameData($("#pro").val());//获取任务
                        } else {
                            toastrCog.error("删除失败", 2000)
                        }
                        $("#delModal").modal("hide");
                    }
                })
            });
        },
        updataSelect: function ($obj, val) {
            $obj.val(val);
            $obj.trigger("chosen:updated");
        },
        getStr:function(selectArr,code){
            var str="";
            for (var i = 0; i < selectArr.length; i++) {
                str += selectArr[i][code] + ",";
            }
            str = str.substr(0, str.length - 1);
            return str;
        },
        rootMultipleArr:function(proArr,code,type){
            var arr=[];
            var codeArr=[];
            if(code){
                codeArr=code.split(",");
            }
            if(type==1){//如果type=1则是班组else则是状态
                for(var i=0;i<codeArr.length;i++){
                    arr.push(bs.getXInY(proArr,"name","value",codeArr[i]));
                }
            }else{
                for(var i=0;i<codeArr.length;i++){
                    arr.push(bs.changeState(codeArr[i],proArr));
                }
            }
            return arr;
        }
    };
    //校验
    var validateFun = {
        init: function () {
            this.initKeyValidatorAdd();
            this.initKeyValidatorEdit();
        },
        initKeyValidatorAdd: function () {
            $("#addForm").jqxValidator({
                rules: [
                    {
                        input: '#proModalAddInput',
                        message: '请选择省份!',
                        action: 'change,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val() == "") {
                                result = false
                            }
                            return result;
                        }
                    }
                    , {
                        input: '#timeModalAddInput',
                        message: '通话时间不能为空',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($("#startTimeAdd").val() == "" || $("#endTimeAdd").val() == "") {
                                result = false
                            }
                            return result;
                        }
                    }, {
                        input: '#taskNameAdd',
                        message: '任务名称不能为空!',
                        action: 'keyup,blur',
                        rule: 'required'
                    }
                    , {
                        input: '#taskNameAdd',
                        message: '任务名称不能包含空格!',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val().indexOf(" ") >-1) {
                                result = false
                            }
                            return result;
                        }
                    },
                    {
                        input: '#taskNameAdd',
                        message: '最多输入'+tools.maxTextLength+'个字符！',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val()!= "") {
                                if($(input).val().length>50){
                                    return false
                                }
                            }
                            return result;
                        }
                    }
                ],
                hintType: "label"
            });
        },
        initKeyValidatorEdit: function () {
            $("#editForm").jqxValidator({
                rules: [
                    {
                        input: '#proModalEditInput',
                        message: '请选择省份!',
                        action: 'change,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val() == "") {
                                result = false
                            }
                            return result;
                        }
                    }
                    , {
                        input: '#timeModalEditInput',
                        message: '任务名称不能为空',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($("#startTimeEdit").val() == "" || $("#endTimeEdit").val() == "") {
                                result = false
                            }
                            return result;
                        }
                    }, {
                        input: '#taskNameEdit',
                        message: '任务名称不能为空!',
                        action: 'keyup,blur',
                        rule: 'required'
                    }
                    , {
                        input: '#taskNameEdit',
                        message: '任务名称不能包含空格!',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val().indexOf(" ") >-1) {
                                result = false
                            }
                            return result;
                        }
                    },
                    {
                        input: '#taskNameEdit',
                        message: '最多输入'+tools.maxTextLength+'个字符！',
                        action: 'keyup,blur',
                        rule: function (input, commit) {
                            var result = true;
                            if ($(input).val()!= "") {
                                if($(input).val().length>50){
                                    return false
                                }
                            }
                            return result;
                        }
                    }
                ],
                hintType: "label"
            });
        }
    };
    $(function () {
        resize.init();
        tools.urlPrev=bs.getSysConfig("SJWJ_URL_PRE").value;
        var oTable = new TableInit();
        oTable.Init();
        tools.init();
        validateFun.init();
    })
</script>
</body>
</html>